package chapter11.Enum;
//枚举类
//1.自定义枚举
public class Enumeration01 {
    public static void main(String[] args) {
        System.out.println(Season.AUTUMN);
        System.out.println(Season.SPRING);
    }
}
class Season{
    private String name;
    private String  desc;

    public static Season SPRING = new Season("春天","温暖");
    public static Season SUMMER = new Season("夏天","热");
    public static Season AUTUMN = new Season("秋天","凉");
    public static Season WINTER = new Season("冬天","冷");
//1.构造器初始化
//2.不需要set方法
//3.在内部创建固定对象
//4.优化可以加入final修饰符，不会导致整个类的加载
    private Season(String name, String desc) {
        this.name = name;
        this.desc = desc;
    }

    public String getName() {
        return name;
    }

    public String getDesc() {
        return desc;
    }

    @Override
    public String toString() {
        return "name+"+getName()+"desc = "+getDesc();
    }
}